package com.yipinhouse.backstage.client;

import com.yipinhouse.backstage.client.param.InsertEstateWebParam;
import com.yipinhouse.backstage.client.param.UpdateEstateWebParam;
import com.yipinhouse.common.result.Result;
import com.yipinhouse.house.client.param.InsertEstateParam;
import com.yipinhouse.house.client.param.UpdateEstateParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(contextId = "estateManageBackClient",name="backstage",path = "backstage")
public interface EstateWebManageClient {

    /**
     * 添加小区
     *
     * @param insertEstateParam
     * @return
     */
    @PostMapping("insertEstate")
    public Result insertEstate(@RequestBody InsertEstateWebParam insertEstateParam);

    /**
     * 上传图片
     *
     * @param file
     * @return
     * @throws Exception
     */
    @PostMapping("uploadImage")
    public Result uploadImage(@RequestBody MultipartFile file) throws Exception;

    /**
     * 修改小区信息
     *
     * @return
     */
    @PostMapping("updateEstate")
    public Result updateEstate(@RequestBody UpdateEstateWebParam param);

    /**
     * 删除小区
     * @return
     */
    @GetMapping("deleteEstate")
    public Result deleteEstate(@RequestParam("estateId") Integer estateId);
}
